HAL HRTIM migration: List of applicable concepts

This section provides information about the HAL HRTIM applicable architecture concepts.

Concepts for HRTIM

Concept

Description

Separation of initialization and configuration functions

The initialization has been split into four levels of functions:

  • HAL_HRTIM_Init: initializes the handle and links it to a HRTIM instance.

  • HAL_HRTIM_SetConfigInterrupt: configures the global interrupts.

  • HAL_HRTIM_SetSynchroInputSource: configures the input synchronization.

  • HAL_HRTIM_SetSynchroOutput: configures the output synchronization.

Removal and conversion of init structure to configuration structure

The init structure has been removed from the handle and converted into set configuration per functional blocks function. For more details HRTIM_InitTypeDef

Renaming of the handle structure

The handle structure has been renamed to hal_hrtim_handle_t.

Renaming unitary init structures

The structure hrtim_InitTypeDef is no longer available, it is replaced by:

  • hal_hrtim_interrupt_src_t

  • hal_hrtim_sync_output_config_t

  • hal_hrtim_sync_input_src_t

Remove MspInit and MspDeInit callbacks

HAL_HRTIM_MspInit and HAL_HRTIM_MspDeInit are no longer available and have been replaced by a user sequence to initialize and configure the HRTIM.

Unitary configuration APIs

New APIs are available to set and get HRTIM features.

Dedicated DMA link APIs replace generic __HAL_LINKDMA macro

The __HAL_LINKDMA macro is no longer provided and new functions HAL_HRTIM_SetDMA() is provided to link an HRTIM HAL handle to a DMA HAL handle.

Introduction of HAL user data set/get APIs

Two functions to Set/Get User Data are available: HAL_HRTIM_SetUserData and HAL_HRTIM_GetUserData.

Individual callback registration APIs replace global register and unregister functions

The callback registration is handled by specific functions for each HRTIM event. These functions are used to register callback functions for different HRTIM events.

Introduce specialized IRQ handlers

Global HAL_HRTIM_IRQHandler was replaced by new functions HAL_HRTIM_<PROCESS>_IRQHandler for each process:

  • HAL_HRTIM_M_IRQHandler: handles all the master timer related interrupts.

  • HAL_HRTIM_TIMA_IRQHandler: handles all the timer A related interrupts.

  • HAL_HRTIM_TIMB_IRQHandler: handles all the timer B related interrupts.

  • HAL_HRTIM_TIMC_IRQHandler: handles all the timer C related interrupts.

  • HAL_HRTIM_TIMD_IRQHandler: handles all the timer D related interrupts.

  • HAL_HRTIM_TIME_IRQHandler: handles all the timer E related interrupts.

  • HAL_HRTIM_TIMF_IRQHandler: handles all the timer F related interrupts.

  • HAL_HRTIM_FLT_IRQHandler: handles all the HR-Timer global interrupts.

HAL implementation with LL inline functions

HAL HRTIM APIs now rely on LL APIs rather than performing direct register access.

Define statements and enumerations redirected to LL equivalents

HAL HRTIM define statements and enumerations are based on LL define statements.

Removal of hardware-related macros in HAL2

All hardware macros have been removed from the HAL HRTIM driver, and equivalent services are ensured through the LL APIs.

Revised and optimized HAL state machine

The HRTIM is now managed by two state machines:

  1. Global state machine

  2. Timer state machine

Revised and optimized HAL API status returns

The HAL HRTIM functions were updated to return:

  • HAL_INVALID_PARAM: in case of a NULL p_config structure pointer.

  • HAL_ERROR: in case of an error.

  • HAL_TIMEOUT: in case of a user timeout.

  • HAL_BUSY: in case of an ongoing process.

  • HAL_OK: in case of a successfully completed operation.

Revised and optimized HAL error management

The HAL error handling mechanisms have been redesigned to improve the detection, reporting, and handling of errors.

Replaced TypeDef suffix with _t in type names

All TypeDef parts of the HAL HRTIM driver have been removed and replaced by _t.

Replaced nonmodifiable pointers with const keywords

Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable.

Assertion implementation and usage in HAL1

The parameters and state are checked using ASSERT_DBG_STATE and ASSERT_DBG_PARAM macros.

Merge HAL extension files with common ones and remove the EX prefix from APIs.

Only one HAL HRTIM header file remains and all macros, define statements, and functions from hal_hrtim_ex.h have been moved to hal_hrtim.h.

Add HAL PPP Services for Drivers with Handle to Retrieve Corresponding Peripheral Clock Frequency.

HAL HRTIM provides new API to retrieve clock frequency: HAL_HRTIM_GetClockFreq.

Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels.

Finite parameters (including HRTIM instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety.

Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions).

All HAL HRTIM functions start with HAL_HRTIM. All HAL HRTIM enums and structs start with hal_hrtim.


Other HAL HRTIM changes

In HAL2, the “simple” APIs are removed. However, users can achieve the same functionality by using sequences of the HRTIM APIs.Below is an example demonstrating how to replace each simple API function, using TIMA and Channel 1 as references where applicable.


Simple Base Start/Stop HR_TIMA - polling/interrupt/DMA

HAL1

HAL2

HAL_HRTIM_SimpleBaseStart(&hrtim, HRTIM_TIMERINDEX_TIMER_A)
HAL_HRTIM_TIM_Start(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleBaseStop(&hrtim, HRTIM_TIMERINDEX_TIMER_A)
HAL_HRTIM_TIM_Stop(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleBaseStart_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HAL_HRTIM_OPT_IT_REPETITION)
HAL_HRTIM_TIM_Start_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleBaseStop_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_OPT_IT_NONE)
HAL_HRTIM_TIM_Stop_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleBaseStart_DMA(&hrtim, HRTIM_TIMERINDEX_TIMER_A, SrcAddr, DestAddr, Length)
dma_config.requests = HAL_HRTIM_OPT_DMA_REPETITION
dma_config.src_addr = SrcAddr
dma_config.dst_addr = DestAddr
dma_config.size_bytes = Length
HAL_HRTIM_SetConfigDMA(&hrtim, &dma_config)
HAL_HRTIM_TIM_Start_DMA(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleBaseStop_DMA(&hrtim, HRTIM_TIMERINDEX_TIMER_A)
dma_config.requests = HAL_HRTIM_OPT_DMA_NONE
HAL_HRTIM_SetConfigDMA(&hrtim, &dma_config)
HAL_HRTIM_TIM_Stop_DMA(&hrtim, HAL_HRTIM_TIMA)

Simple Output Compare Channel Config - TIMA Channel 1

HAL1

HAL2

pSimpleOCChannelCfg.Mode = HRTIM_BASICOCMODE_<mode>;
pSimpleOCChannelCfg.Polarity = HRTIM_OUTPUTPOLARITY_HIGH;
pSimpleOCChannelCfg.IdleLevel = HRTIM_OUTPUTIDLELEVEL_INACTIVE;
pSimpleOCChannelCfg.Pulse = 0x3FF7;
HAL_HRTIM_SimpleOCChannelConfig(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1, pSimpleOCChannelCfg)
/* Configure output_config depending on mode */
/* Mode = HRTIM_BASICOCMODE_TOGGLE */
output_config.set = HAL_HRTIM_OUT_SET_CMP1
output_config.reset = HAL_HRTIM_OUT_RESET_CMP1

/* Mode = HRTIM_BASICOCMODE_INACTIVE */
output_config.set = HAL_HRTIM_OUT_SET_NONE
output_config.reset = HAL_HRTIM_OUT_RESET_CMP1

/* Mode = HRTIM_BASICOCMODE_ACTIVE */
output_config.set = HAL_HRTIM_OUT_SET_CMP1
output_config.reset = HAL_HRTIM_OUT_RESET_NONE

output_config.polarity = HAL_HRTIM_OUTPUT_ACTIVE_HIGH
output_config.idle_level = HAL_HRTIM_OUTPUT_IDLE_INACTIVE
output_config.fault_level = HAL_HRTIM_OUTPUT_FAULT_NONE

HAL_HRTIM_TIM_SetCompareValue(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_COMPARE_UNIT_1, 0x3FF7)
HAL_HRTIM_OUT_SetConfig(&hrtim, HAL_HRTIM_CHA1, &output_config)

Simple Output Compare Start/Stop - TIMA Channel 1 - polling/interrupt/DMA

HAL1

HAL2

HAL_HRTIM_SimpleOCStart(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_OUT_Enable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Start(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleOCStop(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_OUT_Disable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Stop(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleOCStart_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_OPT_IT_CMP1)
HAL_HRTIM_OUT_Enable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Start_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleOCStop_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_OPT_IT_NONE)
HAL_HRTIM_OUT_Disable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Stop_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleOCStart_DMA(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1, SrcAddr, DestAddr, Length)
dma_config.requests = HAL_HRTIM_OPT_DMA_CMP1
dma_config.src_addr = SrcAddr
dma_config.dst_addr = DestAddr
dma_config.size_bytes = Length
HAL_HRTIM_SetConfigDMA(&hrtim, &dma_config)
HAL_HRTIM_OUT_Enable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Start_DMA(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleOCStop_DMA(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
dma_config.requests = HAL_HRTIM_OPT_DMA_NONE
HAL_HRTIM_SetConfigDMA(&hrtim, &dma_config)
HAL_HRTIM_OUT_Disable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Stop_DMA(&hrtim, HAL_HRTIM_TIMA)

Simple PWM Channel Config - TIMA Channel 1

HAL1

HAL2

pSimplePWMChannelCfg.Polarity = HRTIM_OUTPUTPOLARITY_HIGH;
pSimplePWMChannelCfg.IdleLevel = HRTIM_OUTPUTIDLELEVEL_INACTIVE;
pSimplePWMChannelCfg.Pulse = 0x7FEF;
HAL_HRTIM_SimplePWMChannelConfig(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1, pSimplePWMChannelCfg)
output_config.polarity = HAL_HRTIM_OUTPUT_ACTIVE_HIGH;
output_config.idle_level = HAL_HRTIM_OUTPUT_IDLE_INACTIVE
output_config.fault_level = HAL_HRTIM_OUTPUT_FAULT_NONE
output_config.set = HAL_HRTIM_OUT_SET_CMP1
output_config.reset = HAL_HRTIM_OUT_RESET_PERIOD

HAL_HRTIM_TIM_SetCompareValue(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_COMPARE_UNIT_1, 0x7FEF)
HAL_HRTIM_OUT_SetConfig(&hrtim, HAL_HRTIM_CHA1, &output_config)
HAL_HRTIM_TIM_EnablePreload(&hrtim, HAL_HRTIM_TIMA)

Simple PWM Start/Stop - TIMA Channel 1 - polling/interrupt/DMA

HAL1

HAL2

HAL_HRTIM_SimplePWMStart(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_OUT_Enable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Start(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimplePWMStop(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_OUT_Disable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Stop(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimplePWMStart_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_OPT_IT_CMP1)
HAL_HRTIM_OUT_Enable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Start_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimplePWMStop_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_OUT_Disable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Stop_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_OPT_IT_NONE)
HAL_HRTIM_SimplePWMStart_DMA(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1, SrcAddr, DestAddr, Length)
dma_config.requests = HAL_HRTIM_OPT_DMA_CMP1
dma_config.src_addr = SrcAddr
dma_config.dst_addr = DestAddr
dma_config.size_bytes = Length
HAL_HRTIM_SetConfigDMA(&hrtim, &dma_config)
HAL_HRTIM_OUT_Enable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Start_DMA(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimplePWMStop_DMA(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
dma_config.requests = HAL_HRTIM_OPT_DMA_NONE
HAL_HRTIM_SetConfigDMA(&hrtim, &dma_config)
HAL_HRTIM_OUT_Disable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Stop_DMA(&hrtim, HAL_HRTIM_TIMA)

Simple Capture Channel Config - TIMA External Event i

HAL1

HAL2

pSimpleCaptureChannelCfg.Event = HRTIM_EVENT_i;
pSimpleCaptureChannelCfg.EventPolarity = HRTIM_EVENTPOLARITY_HIGH;
pSimpleCaptureChannelCfg.EventSensitivity = HRTIM_EVENTSENSITIVITY_LEVEL;
pSimpleCaptureChannelCfg.EventFilter = HRTIM_EVENTFILTER_NONE;
HAL_HRTIM_SimpleCaptureChannelConfig(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_CAPTUREUNIT_1, pSimpleCaptureChannelCfg)
eev_config.source = HAL_HRTIM_EEVi_GPIO
eev_config.sensitivity = HAL_HRTIM_EEV_LEVEL_HIGH
eev_config.filter = HAL_HRTIM_FDIV1
eev_config.mode = HAL_HRTIM_EEV_SYNCHRONOUS

HAL_HRTIM_EEV_SetConfig(&hrtim, HAL_HRTIM_EEVi, &eev_config)
HAL_HRTIM_TIM_SetCaptureTrigger(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_CAPTURE_UNIT_1, HAL_HRTIM_CAPTURE_EEVi)

Simple Capture Start/Stop - TIMA External Event i - polling/interrupt/DMA

HAL1

HAL2

HAL_HRTIM_SimpleCaptureStart(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_CAPTUREUNIT_1)
HAL_HRTIM_TIM_Start(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleCaptureStop(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_CAPTUREUNIT_1)
HAL_HRTIM_TIM_Stop(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleCaptureStart_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_CAPTUREUNIT_1)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_OPT_IT_CPT1)
HAL_HRTIM_TIM_Start_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleCaptureStop_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_CAPTUREUNIT_1)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_OPT_IT_NONE)
HAL_HRTIM_TIM_Stop_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleCaptureStart_DMA(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_CAPTUREUNIT_1, SrcAddr, DestAddr, Length)
dma_config.requests = HAL_HRTIM_OPT_DMA_CPT1
dma_config.src_addr = SrcAddr
dma_config.dst_addr = DestAddr
dma_config.size_bytes = Length
HAL_HRTIM_SetConfigDMA(&hrtim, &dma_config)
HAL_HRTIM_TIM_Start_DMA(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleCaptureStop_DMA(&hrtim, HAL_HRTIM_TIMA, HRTIM_CAPTUREUNIT_1)
dma_config.requests = HAL_HRTIM_OPT_DMA_NONE
HAL_HRTIM_SetConfigDMA(&hrtim, &dma_config)
HAL_HRTIM_TIM_Stop_DMA(&hrtim, HAL_HRTIM_TIMA)

Simple One Pulse Channel Config - TIMA output Channel 1, External event i

HAL1

HAL2

pSimpleOnePulseChannelCfg.Pulse = 0x7FEF;
pSimpleOnePulseChannelCfg.OutputPolarity = HRTIM_OUTPUTPOLARITY_HIGH;
pSimpleOnePulseChannelCfg.OutputIdleLevel = HRTIM_OUTPUTIDLELEVEL_INACTIVE;

pSimpleOnePulseChannelCfg.Event = HRTIM_EVENT_6;
pSimpleOnePulseChannelCfg.EventPolarity = HRTIM_EVENTPOLARITY_HIGH;
pSimpleOnePulseChannelCfg.EventSensitivity = HRTIM_EVENTSENSITIVITY_RISINGEDGE;
pSimpleOnePulseChannelCfg.EventFilter = HRTIM_EVENTFILTER_NONE;
HAL_HRTIM_SimpleOnePulseChannelConfig(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1, pSimpleOnePulseChannelCfg)
output_config_TF1.polarity = HAL_HRTIM_OUTPUT_ACTIVE_HIGH;
output_config.idle_level = HAL_HRTIM_OUTPUT_IDLE_INACTIVE;
output_config.fault_level = LL_HRTIM_OUT_FAULTSTATE_NONE
output_config.set = HAL_HRTIM_OUT_SET_CMP1
output_config.reset = HAL_HRTIM_OUT_RESET_PERIOD


eev_config.source = HAL_HRTIM_EEV6_GPIO
eev_config.sensitivity = HAL_HRTIM_EEV_EDGE_RISING
eev_config.filter = HAL_HRTIM_FDIV1
eev_config.mode = HAL_HRTIM_EEV_ASYNCHRONOUS

HAL_HRTIM_TIM_SetCompareValue(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_COMPARE_UNIT_1, 0x7FEF)
HAL_HRTIM_OUT_SetConfig(&hrtim, HAL_HRTIM_CHA1, &output_config)
HAL_HRTIM_EEV_SetConfig(&hrtim, HAL_HRTIM_EEVi, &eev_config)
HAL_HRTIM_TIM_SetCaptureTrigger(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_CAPTURE_UNIT_1, HAL_HRTIM_CAPTURE_EEVi)

Simple One Pulse Start/Stop - TIMA output Channel 1, External event i - polling/interrupt

HAL1

HAL2

HAL_HRTIM_SimpleOnePulseStart(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_OUT_Enable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Start(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleOnePulseStop(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_OUT_Disable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Stop(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleOnePulseStart_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_OPT_IT_CMP1)
HAL_HRTIM_OUT_Enable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Start_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SimpleOnePulseStop_IT(&hrtim, HRTIM_TIMERINDEX_TIMER_A, HRTIM_OUTPUT_TA1)
HAL_HRTIM_OUT_Disable(&hrtim, HAL_HRTIM_CHA1)
HAL_HRTIM_TIM_Stop_IT(&hrtim, HAL_HRTIM_TIMA)
HAL_HRTIM_SetConfigInterrupts(&hrtim, HAL_HRTIM_TIMA, HAL_HRTIM_OPT_IT_NONE)